package com.salinity.kun.util;

import java.io.UnsupportedEncodingException;
import java.util.regex.Pattern;

public class StringUtil {

	public static boolean isEmpty(String str) {
		return str==null||str.equals("");
	}
	
	  public static boolean isNumber(String str) {  
	        Pattern pattern = Pattern.compile("^[-\\+]?\\d+(\\.\\d+)?");  
	        return pattern.matcher(str).matches();  
	  }
	  
	  public static String toUtf8(String str){
		 String rsltStr = "";
		  try {
			  rsltStr =  new String(str.getBytes(),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		  return rsltStr;
	  }
	
}
